<template>
	<view>
		<view class="label_list">
			<view class="label_card" v-for="(item,index) in advise" :key="item.id">
				<view class="label_name" @click="changLable(item,index)" :class="index === active ? 'changeStyle' : 'changeStyle1'">{{item.name}}</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				changeSelectHandle: "",
				active: -1,
			};
		},
		props: {
			advise: {
				type: Array,
				default: []
			},

		},
		methods: {
			changLable(item, index) {
				if (this.active === index) {
					return
				} else {
					this.active = index;
				}
			},
		}

	};
</script>

<style scoped lang="scss">
	// 顶部
	.active1{
		background: rgba(255, 84, 69, 0.04);
		color: rgba(255, 84, 69, 1) !important;
	}
	.changeStyle {
		background: rgba(255, 84, 69, 0.04);
		color: rgba(255, 84, 69, 1) !important;
	}

	.changeStyle1 {
		background: rgba(244, 244, 245, 1.0);
		color: rgba(153, 153, 153, 1);
	}

	.label_list {
		display: flex;
		flex-flow: row wrap;
		justify-content: center;

		.label_card {
			width: calc(100% / 4);
			border-radius: 8rpx;
			margin: 24rpx;
			text-align: center;
			line-height: 64rpx;
			background: rgba(248, 248, 251, 1);

			.label_name {
				color: rgba(153, 153, 153, 1);
			}
		}
	}
</style>
